package June;

public class Test_18_4 {
    public static void main(String[] args) {
        A03 a = new A03();
        int[] arr = {0, 1, 2 ,3, 4, 5};
        a.copyArr(arr);
    }
}

// 编写类A03,实现数组的复制功能copyArr，
// 输入旧数组，返回一个新数组，元素和旧数组一样
class A03 {

    public void copyArr(int[] arr) {
        int[] a = new int[arr.length];
        for (int i = 0; i < arr.length; i++) {
            a[i] = arr[i];
        }
        for (int i = 0; i < arr.length; i++) {
            System.out.println(a[i] + "  ");
        }
    }
}